/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.swirrel.listener;

import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;

import org.swirrel.util.MethodCall;
import org.swirrel.util.SwirrelException;

/**
 *
 * @author Gronau
 */
public class SwirrelMouseWheelListener extends AbstractSwirrelListener implements MouseWheelListener{

    private final MethodCall mouseWheelMovedCall;

    public SwirrelMouseWheelListener(MethodCall mouseWheelMovedCall) {
        this.mouseWheelMovedCall = mouseWheelMovedCall;
        if(! checkSignature(mouseWheelMovedCall, MouseWheelEvent.class)) {
            throw new SwirrelException("Method must have none or one MouseWheelEvent argument");
        }
    }

    public void mouseWheelMoved(MouseWheelEvent e) {
        call(mouseWheelMovedCall, e);
    }

}
